#include "lasercontrol_dummy.h"
#include <QTimer>

LaserControlDummy::LaserControlDummy(LaserControlBase *parent) : LaserControlBase(parent)
{

}

void LaserControlDummy::OpenLaser(const SOFTWARESETTINGS mysetting)
{
    Q_UNUSED(mysetting);
    QTimer::singleShot(3000, this, SLOT(checkLaser()));
    isOn=true;
}

void LaserControlDummy:: OpenLaserProcess(const SOFTWARESETTINGS mysetting)
{
    Q_UNUSED(mysetting);
    QTimer::singleShot(3000, this, SLOT(checkLaser()));
    isOn=true;
}

void LaserControlDummy::CloseLaser()
{
    emit laserCloseReady();
    isOn=false;
}

void LaserControlDummy::laserTest()
{
    emit this->laserTestOk();
}

void LaserControlDummy::PortError(const QString &s)
{
    QString errorCode = ("laser");
    errorCode.append(s);
    emit laserError(errorCode);
}

void LaserControlDummy::ReadCaseTemperature()
{
    emit caseTemperature(0.0);
}

void LaserControlDummy::ReadDiodeTemperature()
{
    emit diodeTemperature(0.0);
}

void LaserControlDummy::emissionStateCheck()
{
    if(isOn)
        emit emissionState("ON");
    else
        emit emissionState("OFF");
}

void LaserControlDummy::checkLaser()
{
    emit this->laserOk();
}
void LaserControlDummy::laserReceiveResp(const QByteArray response)
{
    Q_UNUSED(response)
}
